<template>
  <view class="custom-confirm-mask" v-if="visible">
    <view class="custom-confirm-container">
      <view class="custom-confirm-title">{{ title }}</view>
      <view class="custom-confirm-content">{{ content }}</view>
      <view class="custom-confirm-buttons">
        <view class="custom-confirm-button cancel" @click="handleCancel">取消</view>
        <view class="custom-confirm-button confirm" @click="handleConfirm">确定</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '提示'
    },
    content: {
      type: String,
      default: ''
    }
  },
  methods: {
    handleConfirm() {
      this.$emit('confirm');
      this.$emit('update:visible', false);
    },
    handleCancel() {
      this.$emit('cancel');
      this.$emit('update:visible', false);
    }
  }
};
</script>

<style scoped>
.custom-confirm-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.custom-confirm-container {
  width: 600rpx;
  background-color: #fff;
  border-radius: 20rpx;
  padding: 40rpx;
  box-sizing: border-box;
}

.custom-confirm-title {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-bottom: 30rpx;
}

.custom-confirm-content {
  font-size: 28rpx;
  color: #666;
  text-align: center;
  margin-bottom: 40rpx;
}

.custom-confirm-buttons {
  display: flex;
  justify-content: space-between;
}

.custom-confirm-button {
  width: 250rpx;
  height: 80rpx;
  border-radius: 40rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30rpx;
  font-weight: 500;
}

.custom-confirm-button.cancel {
  background-color: #ffeccd;
  color: #FFA726;
}

.custom-confirm-button.confirm {
  background-color: #FFA726;
  color: #fff;
}
</style>